﻿using Kairos.Properties;
using System.Collections.Specialized;
using System.Globalization;
using System.Text;

namespace Kairos.Controllers
{
    public static class RichTextExtensions
    {
        public static string RichText(string richText, NameValueCollection parameters)
        {
            StringBuilder stringBuilder = new StringBuilder(richText);

            foreach (string key in parameters)
            {
                stringBuilder.Replace(string.Format(CultureInfo.InvariantCulture, "{0}{1}{0}",
                    Settings.Default.RichTextToken,
                    key.ToUpper(CultureInfo.InvariantCulture)), parameters[key]);
            }

            return stringBuilder.ToString();
        }



    }
}